import java.util.Scanner;

public class Calculator {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入第一个操作数：");
        double operand1 = scanner.nextDouble();

        System.out.print("请输入第二个操作数：");
        double operand2 = scanner.nextDouble();

        System.out.print("请输入运算符（+、-、*、/）：");
        char operator = scanner.next().charAt(0);

        double result = 0.0;

        switch (operator) {
            case '+':
                result = operand1 + operand2;
                break;
            case '-':
                result = operand1 - operand2;
                break;
            case '*':
                result = operand1 * operand2;
                break;
            case '/':
                if (operand2 != 0) {
                    result = operand1 / operand2;
                } else {
                    System.out.println("错误：除数不能为零！");
                    return;
                }
                break;
            default:
                System.out.println("错误：无效的运算符！");
                return;
        }

        System.out.println("结果：" + result);
    }
}